Commit 2043b46
## Summary
Lands the **verifier-side (parse) half** of ADR-020 (ownership-section
schema versioning), per ADR-021's coordinated landing protocol —
*verifier ships parse-support FIRST*, then producers flip emit together.
This PR is the AffineScript leg.
**Depends on:** #350 (restores the ADR-020/021 + coordination ledger
records this PR references).
## On-wire change (parse-only this PR; emit stays on v1)
**v1** (legacy, unversioned, what we emit today):
```
u32le count
entry*
```
**v2** (ADR-020, parse-only here):
```
u8 0xAF ; sentinel — "AffineScript Format"
u8 version ; 0x02
u32le count
entry* ; same entry shape as v1
```
**Dispatch:** a v2 section starts with the `0xAF` sentinel byte. v1
readers fail cleanly on v2 sections (the sentinel pollutes the
entry-count low byte and yields an implausible count); v2 readers see
the sentinel and branch. Unknown `v2.X` versions yield `[]` (sound
fallback per ADR-021's conservative-disposition axis — loud-correct
rather than silent-wrong).
## What this PR does
- `lib/tw_verify.ml` `parse_ownership_section_payload` — dispatches v1
vs v2 on the leading sentinel byte; v1 path preserved verbatim, v2 path
adds two leading bytes + identical entry decoding.
- `test/test_e2e.ml` — two new hermetic alcotest cases under "E2E
TypedWasm ownership schema":
- `v2 parse round-trip (ADR-020)` — hand-constructed v2 payload, asserts
canonical entry.
- `v2 unknown version -> [] (ADR-021)` — v2.99 (future version) yields
`[]`.
## What this PR does NOT do (deliberately)
- Does **not** flip the producer-side emitter — that stays on v1 until
`hyperpolymath/typed-wasm`'s Rust verifier and `hyperpolymath/ephapax`'s
verifier also ship parse-support. Coordinated landing per ADR-021 axis 2
("verifier ships first").
- Once the sister repos land parse-support, the producer-emit flip is a
separate atomic PR across all three repos.
## Coordination ledger state
After this PR merges, **Q-001** in
`docs/specs/TYPED-WASM-COORDINATION-LEDGER.adoc` is partially de-blocked
on the AffineScript leg:
- `local.verifier-work`: ✅ shipped (this PR)
- `local.producer-work`: ⏳ still v1 emit (correct — verifier-first)
- `typed-wasm.verifier-work`: ⏳ awaiting sister-repo PR
- `ephapax.verifier-work`: ⏳ awaiting sister-repo PR
## Test plan
- [ ] CI `build` job clean
- [ ] CI `dune runtest` green (existing `ownership_schema_tests` v1
round-trips MUST still pass; two new v2 cases land as additions)
- [ ] No new lints
- [ ] Cross-references in commit message / verifier comment resolve once
#350 merges
Refs ADR-020 (parse-side), ADR-021 (coordinated landing).
Depends on: #350
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WHUYQEPKgQU6jBgUj4snYU)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent a22a74c commit 2043b46
2 files changed
Lines changed: 148 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
197 | 218 | | |
198 | 219 | | |
199 | 220 | | |
| |||
205 | 226 | | |
206 | 227 | | |
207 | 228 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
218 | 236 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 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 | + | |
235 | 304 | | |
236 | 305 | | |
237 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1217 | 1263 | | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1221 | 1269 | | |
1222 | 1270 | | |
1223 | 1271 | | |
| |||
0 commit comments