Commit 019db0e
## Summary
Closes proof-debt obligation **P59** from the comprehensive inventory:
certify that the Rust-side `OwnershipKind::from_byte` / `to_byte` pair
(at `src/ephapax-wasm/src/ownership.rs:55-67`) round-trips on every
defined variant.
The `typedwasm.ownership` wasm custom section is the carrier that
crosses the ABI boundary to
`hyperpolymath/typed-wasm:crates/typed-wasm-verify/src/section.rs` — the
**ADR-0002 carrier handshake**. Ephapax emits, typed-wasm verifies. Both
sides MUST agree byte-for-byte; otherwise the verifier observes a
different ownership annotation than the producer emitted, breaking the
cross-tool linearity soundness claim.
## What ships
- **Three mechanically-checked tests** in
`src/ephapax-wasm/src/ownership.rs`, `mod tests`:
- `coq_bridge_p59_owner_byte_map_pinned` — asserts the exact wire byte
for each of the four variants (0=Unrestricted, 1=Linear, 2=SharedBorrow,
3=ExclBorrow). Any change in the byte map is a wire-format break and
trips this test.
- `coq_bridge_p59_owner_round_trip_exhaustive` — direct case-split on
the four variants; equivalent in strength to a property test on a finite
domain.
- `coq_bridge_p59_owner_round_trip` — the `proptest!` form of the same
lemma. Mirrors the standard formulation used in `typed-wasm-verify`'s
own property suite.
- **`docs/coq-rust-bridge/ownership_round_trip.adoc`** — bridge spec
mirroring `docs/coq-rust-bridge/is_linear_ty.adoc` (PR #273). Documents
the wire format, the round-trip claim, the asymmetric decoder fallback
(bytes `4..=255` → `Unrestricted`; NOT a round-trip violation since
`to_byte` never emits those bytes), and cross-links to
typed-wasm-verify's sister consumer.
- **`src/ephapax-wasm/Cargo.toml`** — `proptest` dev-dep added from the
workspace.
- **SPDX flip** on `ownership.rs`: `PMPL-1.0-or-later` → `MPL-2.0` with
the owner line `Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>` (estate
language-policy MPL flip).
## Wire format pinned
| Variant | Wire byte |
|---|---|
| `Unrestricted` | `0` |
| `Linear` | `1` |
| `SharedBorrow` | `2` |
| `ExclBorrow` | `3` |
## Follow-ups (sister obligations)
P59 is the simplest of a three-obligation arc; P60 + P61 ship as
separate PRs:
- **P60** — `ty_to_ownership_kind` monotone w.r.t. linearity. Combined
with P28 (Rust ↔ Coq `is_linear_ty` bridge, landed in #273), this links
the Coq linear type judgment to the emitted wire byte.
- **P61** — full `OwnershipEntry` round-trip:
`parse_ownership_section_payload(build_ownership_section_payload(es)) ==
es`. The existing `mixed_kinds_roundtrip` test exhibits one witness; P61
generalises to a property test on arbitrary entry lists.
Together P59+P60+P61 form the typed-wasm ADR-0002 cross-tool soundness
link.
## Test plan
- [x] `cargo test -p ephapax-wasm --lib` — 89 passed, 0 failed (86
pre-existing + 3 new P59).
- [x] GPG-signed commit (key
`9639451754496E51D6B537CAD119017EBF695AB1`).
- [x] SPDX header on touched Rust file includes `MPL-2.0` + owner line
(pre-commit-hook compatible).
- [x] No `formal/*.v` touched — pure Rust + AsciiDoc work.
## Cross-references
- `PROOF-NEEDS.md` — proof obligation **P59** in the comprehensive
inventory.
- `docs/coq-rust-bridge/is_linear_ty.adoc` — sister bridge document
(P28, PR #273).
- `hyperpolymath/typed-wasm:crates/typed-wasm-verify/src/section.rs` —
canonical reader on the verifier side.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 88b116d commit 019db0e
4 files changed
Lines changed: 274 additions & 2 deletions
File tree
- docs/coq-rust-bridge
- src/ephapax-wasm
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
226 | 307 | | |
0 commit comments