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)
- Bootstrapping and structure enforcement
- Native build orchestration
- Documentation scanning and generation
- Diagnostics, inventory, and verification
- The engine is structurally separate from project code
- Client code does not import engine internals at runtime
- The engine is delivered alongside the project and fully inspectable
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
- Domain logic is isolated from infrastructure
- Public APIs are explicit and discoverable
- Native code is accessed through controlled interfaces
- No build orchestration exists in this layer
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
- Source and artifacts are separated
- Multiple native languages can coexist
- Python runtime never depends on native build logic
- Interfaces are explicitly mapped and versioned
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
- API references reflect actual code
- Native interfaces are documented alongside Python
- Documentation builds in an isolated environment
Verification layer: tests/
Verification is part of the system, not an optional step.
tests/
βββ hooks/
βββ hydra_forge/
βββ io/
βββ conftest.py
- The engine has explicit contracts
- Generated projects are validated against those contracts
- Native integration is tested explicitly
Environment layer: .venv/
Hydra Forge uses explicit, isolated Python environments:
.venv/
βββ user/
βββ dev/
βββ docs/
- Dependency leakage is prevented
- Builds are reproducible
- Documentation can be built independently
Contributor perspective
- Most work happens in
src/<package_name>/ - Native code lives under
_native/src/ - Documentation is regenerated
- Tests validate structure and behavior
- Engine internals are rarely modified
What this structure optimizes for
- Long-term maintainability
- Safe refactoring
- Clear ownership boundaries
- Predictable builds
- Transparent verification
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.