You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(arch): make typed-wasm-verify optional + own the ownership codec in-tree
Group 2 of the estate disentangling: ephapax no longer has a hard
mandatory dep on the typed-wasm repo. After this PR, ephapax builds
+ tests cleanly with `cargo build --no-default-features`, satisfying
the architectural rule that typed-wasm must be removable from
either language with no impact on the language itself.
Design (user-decided 2026-05-26):
1. Section emission is ALWAYS ON — ownership is ephapax's own
discipline (linear types are its core feature), not a typed-wasm
concern. Ephapax now owns its own copy of the section codec.
2. typed-wasm-verify is an OPTIONAL dep, default-on, behind a
feature flag of the same name. Powers the post-codegen
`ephapax compile --verify-ownership` flag.
3. With the feature OFF, `--verify-ownership` becomes a no-op
(warns and continues); the emitted wasm still carries the
`typedwasm.ownership` section so any later off-tree verifier
can pick it up.
Changes:
- New `src/ephapax-wasm/src/ownership.rs` (~210 LoC including
5 unit tests):
* `OWNERSHIP_SECTION_NAME` constant (= "typedwasm.ownership")
* `OwnershipKind` enum + `from_byte`/`to_byte`
* `OwnershipEntry` struct
* `build_ownership_section_payload` / `parse_ownership_section_payload`
* `LenientReader` helper
Byte-for-byte parity with `typed_wasm_verify::section`; any
future wire-format change must be coordinated.
- `src/ephapax-wasm/src/lib.rs`: 13 use sites flipped from
`typed_wasm_verify::*` to `ownership::*` (production + test).
Module re-exports the public surface so existing callers stay
unchanged.
- `src/ephapax-wasm/Cargo.toml`: removed `typed-wasm-verify` dep
entirely. ephapax-wasm now has zero git deps on sibling repos.
- `src/ephapax-cli/Cargo.toml`: `typed-wasm-verify` is now
`{ workspace = true, optional = true }`; new `[features]`
section with `default = ["typed-wasm-verify"]`.
- `src/ephapax-cli/src/main.rs`: `report_ownership_verification`
gated by `#[cfg(feature = "typed-wasm-verify")]`; call site at
`compile_file` runs the verifier when feature ON, prints a
stderr warning + continues when OFF.
- `src/ephapax-cli/tests/cli_verify_ownership.rs`: the 2 positive
tests (assert verifier output) gated by `#[cfg(feature =
"typed-wasm-verify")]`. The negative test (assert verifier
absence without `--verify-ownership`) stays unconditional.
Build matrix verified locally:
- `cargo build --workspace` → clean (default ON)
- `cargo build -p ephapax-cli --no-default-features` → clean
- `cargo test -p ephapax-wasm` → 84/84 passing
(includes the 5 new ownership-codec unit tests)
- `cargo test -p ephapax-cli` → 13/13 passing
- `cargo test -p ephapax-cli --no-default-features` → 13/13 passing
(the 2 verifier tests are cfg-skipped; non-verifier test still
asserts the absence-of-verifier-output)
Stacks on #137 (the typedwasm.ownership rename). When #137 merges,
this PR will auto-retarget to main.
Follow-up: add a `--no-default-features` CI job to ephapax's
workflow to keep the dep-free build green automatically.
Refs: estate disentangling Group 2. Closes the architectural
violation flagged in `project_estate_disentangle_typedwasm.md`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments