Commit d706d52
migration B+C: full-corpus triage + C1 deep wave (8 kernels, 4-gate green) (#535)
ReScript → AffineScript → wasm migration of `hyperpolymath/idaptik`,
staged under `proposals/idaptik/` (the access gate keeps idaptik writes
out of scope; this is *verified + staged + applyable*, not applied). Two
phases on this branch.
## Phase C — deep wave 1 (cluster C1), 4-gate green
Cluster C1 (the eleven `shared/src` leaf modules) re-decomposed into **8
pure-integer co-processor kernels** staged under
`proposals/idaptik/migrated/<Name>/`. Brain = the integers that cross
the wasm boundary; the host keeps strings/floats/DOM/mutable state (the
senses).
| Kernel | Brain | Boundary verdict |
|---|---|---|
| `DeviceType` | 12-device taxonomy: count, validity, code-clamp |
LOSSLESS |
| `PuzzleFormat` | difficulty(4)/tier(5) + DLCLoader clamp-to-default |
CONTROLLED-LOSS @0 |
| `PortNames` | 10 coprocessor-domain port taxonomy (= `portnames.wasm`)
| LOSSLESS |
| `GameEvent` | alertLevel(4, ordered clamp) + direction(6, flat) |
LOSSLESS + CL @0 |
| `Kernel_Compute` | per-domain element caps + 504/413/404/0 scheduler
gate | decision (parity) |
| `Kernel` | 503/404/0 pre-flight gate + domain→handler router |
CONTROLLED-LOSS @4 |
| `RetryPolicy` | 503/504/429 transient classifier + 3-policy table |
decision (parity) |
| `Diagnostics` | <70/<90/≥90 health-band classifier + registry check |
decision (parity) |
**Re-decomposed, not transliterated:** Promise/async collapsed to the
synchronous status *decision*; service-locator reads
(`ResourceAccounting`, backend registry) threaded as explicit integer
params; variants re-encoded as closed integer bands; floats + wall-clock
timing kept host-side.
**Four gates green** (captured in `migrated/EVIDENCE.adoc`):
- **G1 compile** — 8/8 → wasm
- **G2 parity** — 1223/1223 oracle-vs-wasm inputs (independent JS
oracles)
- **G3 echo-boundary** — 6 Agda proofs, `agda exit 0`: 3 LOSSLESS + 3
CONTROLLED-LOSS, each collision named and certified
- **G4 assail** — 8/8 clean (no undeclared clamp / unguarded decoder)
Three C1 files are host-side "senses" with no brain and stay in the
host: `Coprocessor_Backends.res` (registration wiring),
`PortNamesCoprocessor.res` (JS bridge shim — consumes
`PortNames.affine`), `DLCLoader.res` (JSON parser; its one integer
fragment ships as `PuzzleFormat.clamp_tier`).
## Phase B — full-corpus triage (the worklist)
`affine-migratability` over all **571** idaptik `.res` files → the
resumable worklist Phases C–Ω navigate from.
| Verdict | Count | % |
|---|---|---|
| **MIGRATABLE NOW** | 389 | 68% |
| STRING-GATED (wall 1) | 71 | 12% |
| EFFECT-GATED (wall 2) | 111 | 19% |
Non-test production: 358 files, **196 migratable (55%)**. Twelve
clusters C1..C12 ordered leaf-pure-integer-first. Top walls:
module-level `ref()` (79), string subscript (44), `String.length` (30).
- `migration-map.json` — machine worklist (resume rule + per-cluster
files + per-file wall labels); C1 status → **DONE**
- `migration-map.adoc` — human map
- `{state-vs-digest,game-vs-deepspace}.svg` — Phase A determinism
diagrams (not previously committed)
## Ledger
Phase B **DONE**; Phase C wave 1 (C1) **DONE**. **NEXT: C2** — the
`vm/lib/ocaml` instruction set (31 files, the pure-integer reversible VM
opcodes), same 4-gate recipe.
Rebased onto current `main` (incl. #534 codegen-deno WASI stub); #533
evangelist toolkit confirmed merged.
https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3110b49 commit d706d52
30 files changed
Lines changed: 4184 additions & 4 deletions
File tree
- proposals
- idaptik
- migrated
- DeviceType
- Diagnostics
- GameEvent
- Kernel_Compute
- Kernel
- PortNames
- PuzzleFormat
- RetryPolicy
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 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 | + | |
Lines changed: 104 additions & 0 deletions
| 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 | + | |
Lines changed: 25 additions & 0 deletions
| 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 | + | |
Lines changed: 39 additions & 0 deletions
| 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 | + | |
Lines changed: 25 additions & 0 deletions
| 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 | + | |
0 commit comments