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
## Summary
Phase 0 housekeeping — the ROADMAP truthfulness audit that
`docs/PRODUCTION-PATH.adoc` §Phase 0 requires before advancing to Phase
1. Three real drifts found and fixed, plus a new aspect-test section
that catches this drift class going forward.
## Drifts found and fixed
### 1. `spec/10-levels-for-wasm.adoc` →
`spec/type-safety-levels-for-wasm.adoc`
The file was renamed but 5 callers still pointed at the old path:
- `ROADMAP.adoc`
- `README.adoc`
- `EXPLAINME.adoc` (twice)
- `.claude/CLAUDE.md`
All updated.
### 2. `EXPLAINME.adoc` Idris2 ABI table out of date
EXPLAINME described a pre-restructure architecture (Types.idr /
Layout.idr / Access.idr / Effects.idr / Linearity.idr / Foreign.idr).
The actual structure is `src/abi/TypedWasm/ABI/{Region, TypedAccess,
Pointer, Levels, Effects, Lifetime, Linear, MultiModule, Layout, Proofs,
SessionProtocol, ResourceCapabilities, Choreography, Tropical,
Epistemic, Echo, ModuleIsolation}.idr`.
Rewrote claim 3's evidence sentence and the full file table to match
reality, with each entry naming the actual load-bearing types from each
file (`Region.idr` → Schema, sizeOf, alignOf; `TypedAccess.idr` →
HostType, RegionPredicate; `Levels.idr` → Level1_InstructionValidity
through Level10_Linear data types; etc.).
### 3. `src/abi/Foreign.idr` doesn't exist
EXPLAINME's file table claimed `Foreign.idr` provided "FFI declarations:
C header generation from Idris2 ABI". The file doesn't exist (the FFI
surface is `ffi/zig/src/main.zig`, hand-maintained per the comment in
that file's header). Removed the stale row.
## Drift-detection: claim-envelope §8
To prevent this class of drift recurring,
`tests/aspect/claim-envelope.mjs` gets a new section 8 — "Path
references in docs resolve to real files":
- Scans README.adoc, ROADMAP.adoc, EXPLAINME.adoc, .claude/CLAUDE.md
- Matches repo-relative path tokens with extensions:
adoc/md/mjs/res/idr/zig/rs/ebnf/toml/ipkg
- Allowlist: cross-repo paths (`typedqliser/`, `affinescript/`,
`ephapax/`, `standards/`, `hypatia/`, `typell/`, `vql-ut/`, `echidna/`),
templated paths (`{{...}}`), well-known non-repo paths (`github.com`,
`/home/runner/`)
- Skip filter: bare filenames without `/` (those are prose conventions
like "see PROOF-NEEDS.md")
- Prints every stale reference inline (not first-5-only) since rename
drift is what reviewers must see in full
Section 8 now finds 31 path references across the 4 docs, all resolving.
Before this PR's fixes: 7 stale (the EXPLAINME refs to old `src/abi/`
paths).
## Verification
All test surfaces green after the changes:
| Test | Result |
|---|---|
| claim-envelope.mjs | **53 passed, 0 failed, 0 skipped** (was 52; +1
from new section 8) |
| property_test.mjs | 29 passed, 0 failed, 0 skipped |
| security-envelope.mjs | 10 passed, 0 failed, 0 skipped |
| regression.mjs | 25 passed, 0 failed, 1 skipped (idris2 not on PATH) |
| smoke/e2e-smoke.mjs | 40 passed, 0 failed |
| Structural E2E | 53 passed, 0 failed, 1 skipped |
## Files changed
- `.claude/CLAUDE.md` — spec path fix
- `EXPLAINME.adoc` — spec path fix + claim 3 evidence rewrite + file
table restructure
- `README.adoc` — spec path fix in Quick Tour
- `ROADMAP.adoc` — spec path fix in Current State
- `tests/aspect/claim-envelope.mjs` — new section 8 (path-reference
drift detection)
## Closes Phase 0
This PR completes the ROADMAP truthfulness audit checklist item in #48.
After it lands, Phase 0's housekeeping subsection is fully closed.
Remaining Phase 0 items are Track A's multi-PR codegen pipeline work and
Track B's cross-repo AffineScript migration — both outside what one
session can ship.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ExgUTJmU5UQQNLKynwxDjm)_
Co-authored-by: Claude <noreply@anthropic.com>
L11 (tropical cost-tracking) and L12 (epistemic safety) are formally specified and published.**
19
19
____
20
20
21
-
**Evidence**: `/var/mnt/eclipse/repos/typed-wasm/src/abi/Levels.idr` defines Idris2 dependent types for all 10 checked levels: L1 (instruction validity), L2 (region binding), L3 (type compatibility), ..., L10 (linearity). `src/abi/Proofs.idr` contains zero `believe_me`, `assert_total`, or escape hatches. LEVEL-STATUS.md confirms "checked L1-L10 core."
21
+
**Evidence**: `/var/mnt/eclipse/repos/typed-wasm/src/abi/Levels.idr` defines Idris2 dependent types for all 10 checked levels: L1 (instruction validity), L2 (region binding), L3 (type compatibility), ..., L10 (linearity). `src/abi/TypedWasm/ABI/Proofs.idr` contains zero `believe_me`, `assert_total`, or escape hatches. LEVEL-STATUS.md confirms "checked L1-L10 core."
22
22
23
23
L11 and L12 are formally specified in `src/abi/TypedWasm/ABI/Tropical.idr` (L11: AllPairsCosts + Level11KleeneProof) and `src/abi/TypedWasm/ABI/Epistemic.idr` (L12: Level12Proof + freshness witnesses). The full 12-level type hierarchy is given by the `fullCert12` top-level certificate type in `Proofs.idr`.
24
24
@@ -35,13 +35,13 @@ When Module A (compiled from Rust) shares memory with Module B (compiled from Re
35
35
typed-wasm declares the shared schema once. Both modules import it. The typed-wasm checker verifies structural agreement at compile time, before any module runs.
36
36
____
37
37
38
-
**Evidence**: `examples/02-multi-module.twasm` demonstrates: Module A exports a `region Entity` with fields (pos_x, pos_y, hp); Module B imports the same region and defines typed load/store operations. `src/abi/Proofs.idr` proves field offset and alignment agreement.
38
+
**Evidence**: `examples/02-multi-module.twasm` demonstrates: Module A exports a `region Entity` with fields (pos_x, pos_y, hp); Module B imports the same region and defines typed load/store operations. `src/abi/TypedWasm/ABI/Proofs.idr` proves field offset and alignment agreement.
39
39
40
40
**Caveat**: Schema agreement proof is _type-level_ (compile-time). Does NOT verify that actual Rust/AffineScript compiled code respects field layout — correspondence is manual. Runtime behavior depends on correct field packing across compilers.
**Evidence**: `spec/10-levels-for-wasm.adoc` maps each level from database (TypedQL) to WASM. `src/abi/` contains proof files for each: L1-L3 in Types.idr, L4-L5 in Layout.idr, L6-L7 in Access.idr, L8-L10 in Linearity.idr.
44
+
**Evidence**: `spec/type-safety-levels-for-wasm.adoc` maps each level from database (TypedQL) to WASM. The Idris2 proofs live under `src/abi/TypedWasm/ABI/`: `Region.idr` + `TypedAccess.idr` define L1-L3 schema and access typing; `Pointer.idr` defines L4 nullability kinds; `Levels.idr` enumerates `Level1_InstructionValidity` through `Level10_Linear` as data types; `Effects.idr` covers L8; `Lifetime.idr` covers L9; `Linear.idr` covers L10; `Proofs.idr` carries the composed certificates.
45
45
46
46
**Caveat**: Proofs are _about abstract WASM models_, not actual WebAssembly instruction sequences. Translation from `.twasm` (typed-wasm surface syntax) to WASM bytecode is NOT mechanically verified.
47
47
@@ -64,25 +64,28 @@ All share: _Progressive safety levels, mechanized proofs in Idris2, no escape ha
64
64
65
65
| `spec/grammar.ebnf` | The `.twasm` surface syntax in EBNF: region declarations, typed load/store operations, effect annotations, module imports/exports
66
66
67
-
| `spec/10-levels-for-wasm.adoc` | Mapping document: each of the 12 levels from TypedQL (database) → typed-wasm (WASM), with rationale and examples
67
+
| `spec/type-safety-levels-for-wasm.adoc` | Mapping document: each of the 12 levels from TypedQL (database) → typed-wasm (WASM), with rationale and examples
68
68
69
-
| `src/abi/Types.idr` | Idris2 dependent types: L1-L3 proof definitions (instruction validity, region binding, type compatibility) with witness types
69
+
| `src/abi/TypedWasm/ABI/Region.idr` | Schema type, field accessors (`sizeOf`, `alignOf`, `fieldName`, `fieldType`) — load-bearing for L1-L3
70
+
| `src/abi/TypedWasm/ABI/TypedAccess.idr` | Load/store typing: `HostType`, `RegionPredicate`, typed projections through the schema (L2-L3)
71
+
| `src/abi/TypedWasm/ABI/Levels.idr` | The canonical L1-L10 data types — `Level1_InstructionValidity` through `Level10_Linear` and `Nullability` / `RefKind` / `MemEffect` enumerations
70
72
71
-
| `src/abi/Layout.idr` | Idris2 memory layout proofs: L4 (null safety via opt<T>), L5 (compile-time bounds proofs via offset witnesses)
0 commit comments