Commit e315180
AffineScript co-development (round 2): verified Kernel_IO/SecurityRank migration + frontier guide + cross-repo proposals (#532)
## What this is
Round 2 of the AffineScript co-development run (round 1 — the verified
echo-types soundness proof — merged as #531). This round **practises the
idaptik ReScript → AffineScript → wasm migration end-to-end,
host-native**, develops the frontier-practices guide, and stages the
cross-repo proposals. Writes are affinescript-only; everything targeting
another repo is staged under `proposals/` for review.
## Verified this session (every claim was run, not asserted)
| Artifact | Outcome |
|---|---|
| **`Kernel_IO`** — *fresh* re-decomposition | Compiles to wasm (2262B);
`main()` logic **6/6 green** through the wasm. The re-decomposition
*deletes* the `String.startsWith` step — compares Int arrays directly,
so no string crosses the boundary. |
| **`SecurityRank`** — existing port + proof tie-in | Differential
parity **78/78 ALL GREEN** vs a JS oracle; its out-of-band clamp is
certified as controlled loss by the echo-types
`clamp-sentinel-no-section` theorem (demonstrated live:
`rank(-5)=rank(0)=0`, `rank(99)=rank(3)=3`). |
| **`Kernel_Quantum`** — honest non-migration | Documented as
**compiler-gated** on the effect-codegen wall (module `Dict` state +
`Date.now` + `Console.log`), with the re-decomposition path it needs. |
## What's in the diff
- **Guide (first-class, `docs/guides/`)** — the co-processor
integerization chapter in `migration-playbook.adoc` (+444),
`frontier-guide.adoc` Chapter 9 (+145), and the `AI.a2ml` machine
companion (+76). Dual audience: human *and* agent. Six named patterns,
each grounded in a verified example.
- **`proposals/idaptik/`** — the two migrations + the non-migration,
source embedded (AGPL, since idaptik is AGPL-3.0-or-later; kept out of
the MPL tree as standalone files).
- **`proposals/toolchain/`** — six compiler findings: the
variable-string-backend gap (#1 leverage), compiler-emitted `@boundary`
Echo obligations, `--deno-esm` to retire the TS harnesses, the
stale-harness finding (TS + retired podman container),
github-only-network portability, release-cadence coupling, plus the
interpreter/codegen divergence bonus finding.
- **`proposals/standards/`** — drafted normative text (AS-MIG-1/2,
AS-ABI-STR-1, EST-CI-NET-1, the `--deno-esm`/TS-0 exemption amendment,
EST-REL-PIN-1).
## Lessons surfaced
Re-decompose-don't-transliterate (sometimes that means *deleting* the
String); affine types forbid casual aliasing of owned arrays; the
interpreter and wasm codegen **disagree** on a `let mut`
self-reassignment (verify through the wasm); host-native compile vs the
retired container; and the two compiler walls (string backend, effect
codegen) **are** the migration frontier — IO and Quantum are gated on
exactly those.
## Toolchain
Built entirely against the **github-only network policy** (crates.io /
deno.land / opam.ocaml.org all 403): agda+stdlib, ocaml/dune (apt, no
opam), deno (GitHub release), panic-attack — all installed and verified
by routing around the block.
Draft for review.
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 cf0fcdf commit e315180
7 files changed
Lines changed: 1712 additions & 23 deletions
File tree
- docs/guides
- frontier-programming-practices
- proposals
- idaptik
- standards
- toolchain
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
447 | 582 | | |
448 | 583 | | |
449 | 584 | | |
| |||
591 | 726 | | |
592 | 727 | | |
593 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
594 | 733 | | |
0 commit comments