☰ 🏠

Context

What this shows: The enforced initial project structure of Hydra Forge–generated libraries.

  • Clear separation of runtime, dev, and docs environments
  • Deterministic native build locations
  • Structure optimized for long-term maintenance

Project structure

Hydra Forge–generated libraries follow a strict, explicit project structure designed for long-lived scientific and engineering software.

Canonical generated structure

The structure below is taken directly from a Hydra Forge–generated library immediately after successful generation and verification.

It represents the literal output of an inspection utility and is representative of all generated libraries with comparable feature sets.

This structure is not a template β€” it is enforced and verified on every build.

Each area has a single, well-defined responsibility.


Extract from:
(dev) C:\TestLibs\HydraForge_Windows11>python -m forge.structure

β”œβ”€β”€ .venv/                <- isolated environments (user / dev / docs)
β”œβ”€β”€ docs/                 <- generated documentation
β”œβ”€β”€ forge/                <- CLI faΓ§ade
β”œβ”€β”€ hydra_forge/          <- engine (inspectable, non-runtime)
β”œβ”€β”€ runtime/              <- embedded Python + toolchains
β”œβ”€β”€ src/package_name/     <- client library python code
β”‚   β”œβ”€β”€ _native/          <- native source, artifacts, manifests
β”‚   β”œβ”€β”€ io/               <- domain logic
β”‚   β”œβ”€β”€ hooks/            <- extension points
β”‚   └── portal/           <- public Python-facing native interface
β”œβ”€β”€ tests/                <- verification & contracts
β”œβ”€β”€ pyproject.toml
└── README.md

Any deviation from this structure is detected during verification.


Engine layer: hydra_forge/

The hydra_forge/ directory contains the embedded Hydra Forge engine.


forge/        <- user-facing CLI faΓ§ade (namespace, smithery, tree, docs, doctor, structure)
hydra_forge/  <- engine internals (build, scan, verify, expose)

This avoids hidden tooling and reduces long-term dependency on opaque build systems.


Project layer: src/<package_name>/

The src/ directory contains only project-specific code.


β”œβ”€β”€ src//        <- client library code
β”‚   β”œβ”€β”€ _native/          <- native source, artifacts, manifests
β”‚   β”œβ”€β”€ io/               <- domain logic
β”‚   β”œβ”€β”€ hooks/            <- extension points
β”‚   └── portal/           <- public Python-facing native interface
β”œβ”€β”€ _version.py

From a contributor’s perspective, this is a conventional, clean Python package β€” with native acceleration exposed explicitly rather than hidden behind build magic.


Native layer: _native/

Native code is treated as a first-class component.


_native/
β”œβ”€β”€ compiled/             <- built binaries
β”‚   └── exposed/          <- public native API surface
β”œβ”€β”€ src/                  <- native source (C++ / Rust)
β”œβ”€β”€ portal/               <- link to Python-visible interface
β”œβ”€β”€ native_build_map.json
β”œβ”€β”€ native_categories.json
└── version.json

Parity between source, artifacts, and Python exposure is enforced.


Documentation layer: docs/

Documentation is generated directly from code and build artifacts, not maintained by hand.


docs/
β”œβ”€β”€ build/
β”œβ”€β”€ source/
β”‚   β”œβ”€β”€ _static/
β”‚   β”‚   └── hydra_theme.css
β”‚   β”œβ”€β”€ python/
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   └── native_reader_hooks.rst
β”‚   β”‚   β”œβ”€β”€ io/
β”‚   β”‚   β”‚   └── native_readers.rst
β”‚   β”‚   β”œβ”€β”€ hooks.rst
β”‚   β”‚   β”œβ”€β”€ index.rst
β”‚   β”‚   └── io.rst
β”‚   β”œβ”€β”€ conf.py
β”‚   β”œβ”€β”€ forge.rst
β”‚   β”œβ”€β”€ hydra_forge_engine.rst
β”‚   β”œβ”€β”€ index.rst
β”‚   └── portal.rst
└── MakeFile

Verification layer: tests/

Verification is part of the system, not an optional step.


tests/
β”œβ”€β”€ hooks/
β”œβ”€β”€ hydra_forge/
β”œβ”€β”€ io/
└── conftest.py

Environment layer: .venv/

Hydra Forge uses explicit, isolated Python environments:


.venv/
β”œβ”€β”€ user/
β”œβ”€β”€ dev/
└── docs/

Contributor perspective


What this structure optimizes for

It does not optimize for minimal file count or ad-hoc experimentation.


Summary

The Hydra Forge project structure encodes engineering decisions directly into the filesystem, enabling safe evolution without tribal knowledge.

See this structure being generated live