I2784 — One portable core runs on the host and as wasm32, and one executed fixture holds both
Create apps/majordomus-core holding canonical JSON, SHA-256 and the canonical digest, depending only on serde_json and sha2 with the executable's features, exporting a three-function C ABI on wasm32; make the executable's two canonical-JSON writers call it; record a fixture of inputs, canonical bytes and independently computed digests; prove the host crate, the executable and the executed wasm32 module against it in a structure gate; and make the core part of the executable's generation.
READY wave 0 · p1 · implementation profile · runs alone
Ready. Every dependency is done, so majordomus plan start I2784 will be accepted.
Objective
Create apps/majordomus-core holding canonical JSON, SHA-256 and the canonical digest, depending only on serde_json and sha2 with the executable's features, exporting a three-function C ABI on wasm32; make the executable's two canonical-JSON writers call it; record a fixture of inputs, canonical bytes and independently computed digests; prove the host crate, the executable and the executed wasm32 module against it in a structure gate; and make the core part of the executable's generation.
Why
On 2026-10-16 the owner asked for a browser to compute for the mesh. A browser can only be checked if it computes exactly what the server computes, and that can only be known when one implementation runs in both places and an executed fixture says they agree (ADR 0170).
Current state
No portable core; canonical JSON is written twice in the executable; no wasm32 target.
Desired state
apps/majordomus-core builds for the host and wasm32; journal.rs and executor.rs call it; the portable-core gate executes the module against the fixture; a core edit changes the executable's generation.
Scope
- apps/majordomus-core
- apps/majordomus-cli/Cargo.toml
- apps/majordomus-cli/Cargo.lock
- apps/majordomus-cli/build.rs
- apps/majordomus-cli/src/generation.rs
- apps/majordomus-cli/src/mesh/journal.rs
- apps/majordomus-cli/src/capability/executor.rs
- apps/majordomus-cli/tests/portable_core.rs
- .ai/repo/ci/gates.yaml
- .ai/repo/adrs
- scripts/ci/crate-boundary
- rust-toolchain.toml
Dependencies
None. This issue is a root of the graph.
Acceptance criteria
- Every fixture row is reproduced by the core on the host, by the executable's two writers, and by the wasm32 module executed under node
- Text that is not JSON is refused, not digested, on every runtime
- Neither lock gains a package
- A core source edit changes the executable's generation; a core test edit does not
Validation
- majordomus plan validate
- cargo test --manifest-path apps/majordomus-core/Cargo.toml
- cargo test --test portable_core
- cargo test --lib generation
Evidence required
- portable_core_tests
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Timeline
- started
- —
- verified
- —
- completed
- —
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I2784.yaml. Read it back with majordomus plan show I2784.