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 ownership codec in-tree (Group 2) (#142)
## Summary
**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**.
## 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 OPTIONAL, 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 still pick it up.
## What changed
- **New `src/ephapax-wasm/src/ownership.rs`** (~210 LoC + 5 unit tests):
- `OWNERSHIP_SECTION_NAME` = `"typedwasm.ownership"`
- `OwnershipKind` + `from_byte`/`to_byte`
- `OwnershipEntry`
- `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 external callers are
unchanged.
- **`src/ephapax-wasm/Cargo.toml`** — `typed-wasm-verify` dep removed
entirely. `ephapax-wasm` now has **zero git deps on sibling repos**.
- **`src/ephapax-cli/Cargo.toml`** — `typed-wasm-verify = { workspace =
true, optional = true }`; new `[features]` with `default =
["typed-wasm-verify"]`.
- **`src/ephapax-cli/src/main.rs`** — `report_ownership_verification`
gated by `#[cfg(feature = "typed-wasm-verify")]`; call site warns +
continues when feature is OFF.
- **`src/ephapax-cli/tests/cli_verify_ownership.rs`** — 2 positive
verifier-output tests gated; the negative absence-of-verifier-output
test stays unconditional.
## Test plan
- [x] `cargo build --workspace` → clean (default ON)
- [x] `cargo build -p ephapax-cli --no-default-features` → clean
- [x] `cargo test -p ephapax-wasm` → **84/84 passing** (includes 5 new
ownership-codec unit tests)
- [x] `cargo test -p ephapax-cli` → **13/13 passing**
- [x] `cargo test -p ephapax-cli --no-default-features` → **13/13
passing** (verifier tests cfg-skipped, absence-test still runs)
## Stacking + retarget
This PR is based on the `rename/typedwasm-ownership-section` branch
(ephapax#137). When #137 merges, GitHub will auto-retarget this PR to
`main`.
## Follow-up
Adding a `--no-default-features` CI job to ephapax's workflow would keep
the dep-free build green automatically. Out of scope for this PR; happy
to file as a separate fix.
## Refs
- Closes the architectural violation flagged in the estate disentangling
project memory (Group 2).
- Group 1 PRs (the rename): typed-wasm#65, affinescript#375 (MERGED),
ephapax#137, ephapax#140.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments