The repository is a mirror of runtime execution contexts.
Everything else follows from this.
MAP is designed so that the filesystem structure directly reflects where code can execute at runtime. If two pieces of code can compile together, they can run together. If they cannot run together, they are isolated at the repository and workspace level.
This alignment is intentional and foundational: it prevents entire classes of runtime errors, dependency leaks, and architectural drift.
Ignoring tests for the moment, MAP has two primary execution contexts:
- hApp — Holochain App (WASM execution context)
- Host — Native execution context (Rust + TypeScript)
Each execution context has:
- its own workspace
- its own dependency resolution
- its own runtime constraints
There is no “mixed” execution context. Boundaries are strict by design.
| Execution Context | Workspace | Purpose |
|---|---|---|
| hApp (WASM) | happ/ |
Everything compiled into a Holochain App |
| Host (Native) | host/ |
Everything running natively (CLI, Conductura, HX/UI, orchestration) |
| Coordination | root workspace | IDE support + dependency version coordination only |
| Test | tests/ |
Sweettest, Tryorama, fixtures, executors |
Important:
The root workspace is never a build target. Builds must always be run from happ/ or host/.
MAP code falls into exactly three crate classes, distinguished by where they live.
- Live under
happ/ - Compiled to WASM
- Subject to Holochain’s strict runtime constraints (which are more restrictive than generic Rust→WASM)
- Include:
- Zomes
- Workers
- hApp/DNA packaging logic and generated artifacts (e.g.
dna.yaml,happ.yaml)
Mental rule:
If it touches Holochain APIs, it belongs here.
- Live under
host/ - Full native Rust environment
- May use threads, async runtimes, filesystem access, OS APIs
- Include:
- Conductura (host command and integration layer)
- CLI and command dispatch
- Receptors and external integrations
- Host orchestration and runtime setup
- TypeScript-based Human Experience (HX/UI) layer
Mental rule:
If it requires native capabilities, it belongs here.
- Live under
shared_crates/ - Not their own workspace
- Compiled into both hApp and Host
- Must obey the strictest common denominator of runtime constraints (hApp-safe)
Practically this means:
- No multithreading
- No OS assumptions
- No host-only dependencies
- Conservative feature usage
Mental rule:
Shared crates are WASM-first, even when used on the host.
Shared crates are intentionally not placed in their own workspace.
Reasons:
- They are compiled separately in both
happandhost - Feature resolution occurs in the consuming workspace
- Different feature sets may be enabled in hApp vs Host
- This prevents accidental leakage of host-only features into WASM
Shared crates should be thought of as pure libraries whose behavior is shaped by where they are linked.
Each build workspace maintains its own dependency lockfile:
happ/Cargo.lock— authoritative for hApp/WASM buildshost/Cargo.lock— authoritative for native builds
The root workspace does not produce a build lockfile.
- The root workspace centralizes declared dependency versions via
workspace = true - This supports IDE tooling and expresses version intent
- Actual resolution and locking happens per workspace
Version differences between happ/Cargo.lock and host/Cargo.lock are expected and valid, reflecting different runtime needs.
Holochain pins a Minimum Supported Rust Version (MSRV) that MAP must honor — MAP must not independently upgrade Rust beyond that constraint.
MAP enforces deterministic, MSRV-safe builds across all execution contexts.
This is achieved through strict lockfile discipline, not ad-hoc dependency pinning.
Cargo.lock is the single source of truth for resolved dependencies.
Cargo.tomlexpresses compatibility intentCargo.lockcaptures actual, reproducible resolution
This distinction is critical in a multi-workspace repository with differing runtime constraints.
When a transitive dependency introduces a Rust version incompatibility (e.g. an MSRV bump):
- Do not add the dependency to
Cargo.tomlsolely to pin its version - Do not use
[patch.crates-io]for MSRV management - Resolve the issue by updating the workspace lockfile explicitly, for example:
cargo update -p zip@7.4.0 –precise 7.3.0
- Commit the resulting
Cargo.lock - CI and all developers inherit the exact same dependency graph
This approach preserves:
- clean dependency intent
- deterministic builds
- correct separation between compatibility and resolution
Cargo.lockmust be committed for all build workspaces- Clean scripts must not delete
Cargo.lock cargo updateis never run casuallycargo updateis run only:- during a deliberate dependency upgrade
- by a single developer
- with lockfile diffs reviewed and committed
When a core dependency upgrades its MSRV:
- A developer intentionally runs
cargo updatein the affected workspaces - The new dependency graph is reviewed
- Updated lockfiles are committed
- The repository moves forward as a unit
This makes MSRV changes explicit, auditable, and reversible.
Conductora is a host-side command and integration subsystem.
It currently provides:
- Command dispatch and mapping
- Configuration setup
- Receptor registration and management
- Integration bridges (including the Holochain receptor)
- Host runtime orchestration
Conductura never runs inside WASM and should always be treated as host infrastructure, even when it interacts closely with hApps.
The tests/ directory mirrors real execution contexts rather than bypassing them.
It includes:
- Sweettest and Tryorama
- Test harnesses and execution support
- Fixtures and executors that model real runtime behavior
Key principle:
Tests do not relax architectural constraints — they enforce them.
To preserve isolation and reproducibility:
- All builds must use the provided build scripts
- Builds must be executed from workspace roots (
happ/orhost/) - Never run
cargo buildorcargo testfrom the repository root Cargo.lockfiles are workspace-local and intentional
Violating these rules will lead to non-reproducible builds and subtle dependency errors.
If you’re unsure where code belongs, ask:
“Could this run inside Holochain WASM?”
If the answer is no, it does not belong in shared_crates/ or happ/.
That single heuristic will prevent most architectural violations.